import request from '@/utils/request'

// 查询考试信息列表
export function listExamation(query) {
  return request({
    url: '/examation/examation/list',
    method: 'get',
    params: query
  })
}

// 查询考试信息所有列表
export function listAllExamation(query) {
  return request({
    url: '/examation/examation/listAll',
    method: 'get',
    params: query
  })
}

// 查询考试信息详细
export function getExamation(id) {
  return request({
    url: '/examation/examation/getInfo/' + id,
    method: 'get'
  })
}

// 新增考试信息
export function addExamation(data) {
  return request({
    url: '/examation/examation/add',
    method: 'post',
    data: data
  })
}

// 修改考试信息
export function updateExamation(data) {
  return request({
    url: '/examation/examation/edit',
    method: 'post',
    data: data
  })
}

// 删除考试信息
export function delExamation(id) {
  return request({
    url: '/examation/examation/remove/' + id,
    method: 'get'
  })
}

// 查询考试关联的班次列表
export function getExamClasses(examId, query) {
  return request({
    url: '/examation/examation/classes/' + examId,
    method: 'get',
    params: query
  })
}

// 新增考试班次关系
export function addExamClass(examId, classIds) {
  return request({
    url: '/examation/examation/addClass/' + examId,
    method: 'post',
    data: classIds
  })
}

// 移除考试班次关系
export function removeExamClass(examId, classId) {
  return request({
    url: '/examation/examation/removeClass/' + examId + '/' + classId,
    method: 'delete'
  })
}